package com.kun.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.kun.entity.Blog;
import com.kun.entity.BlogType;
import com.kun.mapper.BlogTypeMapper;
import com.kun.service.BlogTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author SunKun
 * @since 2021-06-14
 */
@Service
public class BlogTypeServiceImpl implements BlogTypeService {
    @Autowired
    private BlogTypeMapper blogTypeMapper;

    /**
     * 查询每个博客分类下的博客名称及博客数量
     *
     * @return
     * @throws Exception
     */
    public List<BlogType> queryBlogTypeAndBlogCount() throws Exception{
        return blogTypeMapper.queryBlogTypeAndBlogCount();
    }

    /**
     * 查看博客类型
     * @return
     */
    @Override
    public List<BlogType> selectBlogType() {
        return blogTypeMapper.selectBlogType();
    }

    /**
     * 后台博客类型查询分页
     * @param page
     * @return
     */
    @Override
    public IPage<BlogType> blogTypePage(IPage<BlogType> page) {
        return blogTypeMapper.blogTypePage(page);
    }

}
